	set more off
	global directory ""

	////////////////////////////////////////
	// 									  //
	// 				TABLE 1	  			  //
	// 									  //
	////////////////////////////////////////
		
	use "$directory/Parents_Sample", clear
	
	foreach depvar in Inc_less_18k Inc_more_31k Inc_more_52k Inc_more_100k {
			
		mean `depvar'

		reg  `depvar' score if parentsscore < ., r

		reg  `depvar' score parentsscore, r
			
	}
			

	foreach depvar in Inc_less_18k Inc_more_31k Inc_more_52k Inc_more_100k {
		
	use "$directory/Siblings_Sample" if Inc_less_18k < ., clear 
			
			
	bysort fam: gen N = _N 
	drop if N < 2

		
	xtset fam
				
	foreach depvar in Inc_less_18k Inc_more_31k Inc_more_52k Inc_more_100k {
		
		mean `depvar'
			
		reg `depvar' score, r

		xtreg `depvar' score, fe cluster(fam)
			
	}

	////////////////////////////////////////
	// 									  //
	// 				TABLE 2	  			  //
	// 									  //
	////////////////////////////////////////

	use "$directory/Parents_Sample", clear
	
	foreach depvar in uncond_wages cond_wages onet_YoS_expert compulsory SLA noqual college YoS { 
						
		mean `depvar'

		reg  `depvar' score parentsscore, r
			
	}
			
	foreach depvar in uncond_wages cond_wages onet_YoS_expert compulsory SLA noqual college YoS { 
			
		use "$directory/Siblings_Sample" if `depvar' < ., clear
			
		bysort fam: gen N = _N 
		drop if N < 2
			
		xtset fam
		
		mean `depvar'

		xtreg `depvar' score, fe cluster(fam)
			
	}
	
	////////////////////////////////////////
	// 									  //
	// 				TABLE 3	  			  //
	// 									  //
	////////////////////////////////////////

	use "$directory/Siblings_Sample" if score < ., clear
	
	bysort fam: gen N = _N
	drop if N < 2
	
	bysort fam: egen mean = mean(score)
	gen deltascore = score - mean
	
	
	tempfile siblings_sample
	
	
	sort n_eid
	save `siblings_sample'
	
	
	
	use "$directory/Parents_Sample", clear
	
	merge 1:1 n_eid using `siblings_sample'
	
	gen parents_sample  = (_merge == 1 | _merge == 3)
	gen siblings_sample = (_merge == 2 | _merge == 3)
	drop _merge
	
	
	keep if SLA < . & YoS < .
	

	summ SLA 
	replace SLA = (SLA - r(mean))
	
	summ YoS
	replace YoS = YoS - r(mean)
	
	gen SLA_score 			= SLA * score
	gen SLA_parentsscore 	= SLA * parentsscore
	gen SLA_deltascore 		= SLA * deltascore

	gen YoS_score 			= YoS * score
	gen YoS_parentsscore 	= YoS * parentsscore
	gen YoS_deltascore 		= YoS * deltascore

	gen college_score 		= college * score
	gen college_parentsscore= college * parentsscore
	gen college_deltascore  = college * deltascore
	
	
	
	reg lnwages SLA_score SLA_parentsscore SLA score parentsscore if parents_sample == 1, r
			
	ivregress 2sls lnwages SLA (SLA_score score = SLA_deltascore deltascore) if siblings_sample == 1, r

		
		
	reg lnwages college_score college_parentsscore college score parentsscore, r
				
	ivregress 2sls lnwages college (college_score score = college_deltascore deltascore), r
		

		
	reg lnwages YoS_score YoS_parentsscore YoS score parentsscore if parents_sample == 1, r
		
	ivregress 2sls lnwages YoS (YoS_score score = YoS_deltascore deltascore), r
		
	////////////////////////////////////////
	// 									  //
	// 				TABLE 5	  			  //
	// 									  //
	////////////////////////////////////////

	use "$directory/Parents_Sample", clear
			
	
	foreach depvar in reaction_time visual_memory prospective_memory fluid_intelligence  neuroticism risk_taking N_testosterone obese2 N_glucose  currently_smoking nolonger_smoking N_accelerometer alcohol_abuse N_GGT {
			
		mean `depvar'

		reg  `depvar' score parentsscore, r

	}
		
	////////////////////////////////////////
	// 									  //
	// 				TABLE 6	  			  //
	// 									  //
	////////////////////////////////////////

	use "$directory/ROSLA_Sample", clear
	
	foreach depvar in fluid_intelligence obese2 N_glucose currently_smoking nolonger_smoking N_accelerometer alcohol_abuse N_GGT {		
			
		mean `depvar'

		ivregress 2sls `depvar' $trends10 (SLA = after) [aw=w10], r

	}
